package com.demo.cms.model;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import com.demo.core.model.support.NestedSetModel;

/**
 * 文章栏目模型
 * 文章栏目模型对文章进行归类
 * 并且对栏目的访问(文章的访问)提供许可和统计
 * 
 * @author ryuu.kk
 *
 */
public class Category extends NestedSetModel {

	/**
	 * 版本序列化ID
	 */
	private static final long serialVersionUID = -2061114496752147202L;

	/**
	 * 频道外键ID
	 */
	private Long channelId;
	
	/**
	 * 频道地址(生成链接用)
	 */
	private String channelPath;
	
	/**
	 * 模板外键ID
	 */
	private Long templateId;
	
	/**
	 * 栏目Name
	 */
	//private String name;
	
	/**
	 * 栏目标题
	 */
	private String title;
	
	/**
	 * 关键字
	 */
	private String keyWords;
	
	/**
	 * 栏目路径
	 */
	private String path;
	
	/**
	 * 描述
	 */
	private String description;
	
	/**
	 * 栏目是否是草稿状态
	 */
	private boolean isDraft;
	
	/**
	 * 是否需要对栏目访问进行许可判断
	 */
	private boolean isPermission;
	
	/**
	 * 栏目是否需要分析
	 */
	private boolean isAnalyse;
	
	/**
	 * 栏目类型
	 */
	private String type;
	
	/**
	 * 栏目是否可用
	 */
	private boolean enabled;
	
	/**
	 * 栏目状态
	 */
	private String status;
	
	/**
	 * 数据国际化CODE
	 */
	private String i18n;
	
	/**
	 * 栏目的优先级排序
	 */
	private int priority;
	
	/**
	 * 创建用户
	 */
	private Long createUser;
	
	/**
	 * 创建时间
	 */
	private Date createDate;
	
	/**
	 * 修改用户
	 */
	private Long modifyUser;
	
	/**
	 * 修改时间
	 */
	private Date modifyDate;
	
	/**
	 * 备注
	 */
	private String notes;

	/**
	 * 取得关键字列表
	 * @return List<String> 关键字列表
	 */
	public List<String> getKeywordList() {
		if (keyWords != null && keyWords.length() > 0) {
			return Arrays.asList(keyWords.split(","));
		}
		return new ArrayList<String>(0);
	}
	
	public Long getChannelId() {
		return channelId;
	}

	public void setChannelId(Long channelId) {
		this.channelId = channelId;
	}

	public String getChannelPath() {
		return channelPath;
	}

	public void setChannelPath(String channelPath) {
		this.channelPath = channelPath;
	}

	public Long getTemplateId() {
		return templateId;
	}

	public void setTemplateId(Long templateId) {
		this.templateId = templateId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getKeyWords() {
		return keyWords;
	}

	public void setKeyWords(String keyWords) {
		this.keyWords = keyWords;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isDraft() {
		return isDraft;
	}

	public void setDraft(boolean isDraft) {
		this.isDraft = isDraft;
	}

	public boolean isPermission() {
		return isPermission;
	}

	public void setPermission(boolean isPermission) {
		this.isPermission = isPermission;
	}

	public boolean isAnalyse() {
		return isAnalyse;
	}

	public void setAnalyse(boolean isAnalyse) {
		this.isAnalyse = isAnalyse;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getI18n() {
		return i18n;
	}

	public void setI18n(String i18n) {
		this.i18n = i18n;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public Long getCreateUser() {
		return createUser;
	}

	public void setCreateUser(Long createUser) {
		this.createUser = createUser;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Long getModifyUser() {
		return modifyUser;
	}

	public void setModifyUser(Long modifyUser) {
		this.modifyUser = modifyUser;
	}

	public Date getModifyDate() {
		return modifyDate;
	}

	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}

	public String getNotes() {
		return notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}
}